package com.entity.def;

import com.ymx.darling.util.StringUtil;
import com.ymx.darling.wrapper.fragment.TableInfo;

public class UserDef implements TableInfo {
	private static final String TABLE_NAME = "user";

	public static final UserDef user = UserDef.as("");

	private final String currentTableName;

	private final String aliaName;

	public final String address;

	public final String is_deleted;

	public final String phone;

	public final String sex;

	public final String name;

	public final String delete_by;

	public final String political;

	public final String id;

	public final String version;

	public final String t_id;

	public final String age;

	public final String[] default_columns;

	private UserDef(String aliaName) {
		this.aliaName = aliaName;
		if (StringUtil.isNull(aliaName)) {
			aliaName = TABLE_NAME;
			currentTableName = TABLE_NAME;
		} else {
			currentTableName = TABLE_NAME + " AS " + aliaName;
		}
		this.address = aliaName + "." + "address";
		this.is_deleted = aliaName + "." + "is_deleted";
		this.phone = aliaName + "." + "phone";
		this.sex = aliaName + "." + "sex";
		this.name = aliaName + "." + "name";
		this.delete_by = aliaName + "." + "delete_by";
		this.political = aliaName + "." + "political";
		this.id = aliaName + "." + "id";
		this.version = aliaName + "." + "version";
		this.t_id = aliaName + "." + "t_id";
		this.age = aliaName + "." + "age";
		this.default_columns = new String[]{address, is_deleted, phone, sex, name, delete_by, political, id, version, t_id, age};
	}

	public static UserDef as(String aliaName) {
		return new UserDef(aliaName);
	}

	@Override
	public String getTableName() {
		return this.currentTableName;
	}

	@Override
	public String getAliaName() {
		return this.aliaName;
	}

}